<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/yuwanzi.io/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/yuwanzi.io/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/yuwanzi.io/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/yuwanzi.io/images/logo.svg" color="#222">

<link rel="stylesheet" href="/yuwanzi.io/css/main.css">



<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.1/css/all.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css">

<script class="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"suyuhuan.gitee.io","root":"/yuwanzi.io/","images":"/yuwanzi.io/images","scheme":"Muse","version":"8.2.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":false,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"Suche...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"}};
  </script>
<meta name="description" content="概述 &amp;nbsp;&amp;nbsp;Spring Security是Spring项目的安全框架,基于IoC和AOP来实现安全的功能. &amp;nbsp;&amp;nbsp;Spring Security有两个重要概念:  认证(Authentication),认证即确认用户可以访问当前系统. 授权(Authorization),授权即确定用户在当前系统下所拥有的权限.  配置 &amp;nbsp;&amp;nbsp;Spring S">
<meta property="og:type" content="article">
<meta property="og:title" content="Spring Security安全控制">
<meta property="og:url" content="https://suyuhuan.gitee.io/yuwanzi.io/2016/08/02/2016-08-2-Spring-security/index.html">
<meta property="og:site_name" content="玉丸子 | Blog">
<meta property="og:description" content="概述 &amp;nbsp;&amp;nbsp;Spring Security是Spring项目的安全框架,基于IoC和AOP来实现安全的功能. &amp;nbsp;&amp;nbsp;Spring Security有两个重要概念:  认证(Authentication),认证即确认用户可以访问当前系统. 授权(Authorization),授权即确定用户在当前系统下所拥有的权限.  配置 &amp;nbsp;&amp;nbsp;Spring S">
<meta property="og:locale">
<meta property="og:image" content="http://ww1.sinaimg.cn/mw690/63503acbjw1f6lgu4c6xxj20h404x0tn.jpg">
<meta property="og:image" content="http://ww3.sinaimg.cn/mw690/63503acbjw1f6lft8zsnrj20mu01i3yx.jpg">
<meta property="og:image" content="http://ww3.sinaimg.cn/mw690/63503acbjw1f6lft99qxaj20mj05fjsf.jpg">
<meta property="og:image" content="http://ww3.sinaimg.cn/mw690/63503acbjw1f6lft9j25zj20mo09b40j.jpg">
<meta property="og:image" content="http://ww2.sinaimg.cn/mw690/63503acbjw1f6lg2d5ezej20gn0cadhp.jpg">
<meta property="og:image" content="http://ww4.sinaimg.cn/mw690/63503acbjw1f6lg2cv17nj20ls0g80wk.jpg">
<meta property="og:image" content="http://ww3.sinaimg.cn/mw690/63503acbjw1f6lg2dfhjxj20qe0d7tcp.jpg">
<meta property="og:image" content="http://ww2.sinaimg.cn/mw690/63503acbjw1f6lg2dua5xj20md06s75u.jpg">
<meta property="og:image" content="http://ww4.sinaimg.cn/mw690/63503acbjw1f6lgfcr8g3j20hy01jt8z.jpg">
<meta property="article:published_time" content="2016-08-02T10:00:00.000Z">
<meta property="article:modified_time" content="2020-11-07T00:58:17.000Z">
<meta property="article:author" content="玉丸子">
<meta property="article:tag" content="Java">
<meta property="article:tag" content="Spring">
<meta property="article:tag" content="Spring Boot">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://ww1.sinaimg.cn/mw690/63503acbjw1f6lgu4c6xxj20h404x0tn.jpg">


<link rel="canonical" href="https://suyuhuan.gitee.io/yuwanzi.io/2016/08/02/2016-08-2-Spring-security/">


<script class="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh'
  };
</script>
<title>Spring Security安全控制 | 玉丸子 | Blog</title>
  




  <noscript>
  <style>
  body { margin-top: 2rem; }

  .use-motion .menu-item,
  .use-motion .sidebar,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header {
    visibility: visible;
  }

  .use-motion .header,
  .use-motion .site-brand-container .toggle,
  .use-motion .footer { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle,
  .use-motion .custom-logo-image {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line {
    transform: scaleX(1);
  }

  .search-pop-overlay, .sidebar-nav { display: none; }
  .sidebar-panel { display: block; }
  </style>
</noscript>

<link rel="alternate" href="/yuwanzi.io/atom.xml" title="玉丸子 | Blog" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Navigationsleiste an/ausschalten" role="button">
    </div>
  </div>

  <div class="site-meta">

    <a href="/yuwanzi.io/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">玉丸子 | Blog</h1>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>







</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          Inhaltsverzeichnis
        </li>
        <li class="sidebar-nav-overview">
          Übersicht
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%A6%82%E8%BF%B0"><span class="nav-number">1.</span> <span class="nav-text">概述</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%85%8D%E7%BD%AE"><span class="nav-number">2.</span> <span class="nav-text">配置</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Spring-Security%E9%85%8D%E7%BD%AE%E7%B1%BB"><span class="nav-number">2.1.</span> <span class="nav-text">Spring Security配置类</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Authentication"><span class="nav-number">2.2.</span> <span class="nav-text">Authentication</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Authorization"><span class="nav-number">2.3.</span> <span class="nav-text">Authorization</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%87%AA%E5%AE%9A%E4%B9%89%E7%99%BB%E5%BD%95%E5%AE%9E%E7%8E%B0"><span class="nav-number">3.</span> <span class="nav-text">自定义登录实现</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Spring-Boot%E6%94%AF%E6%8C%81"><span class="nav-number">4.</span> <span class="nav-text">Spring Boot支持</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#end"><span class="nav-number">5.</span> <span class="nav-text">end</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">玉丸子</p>
  <div class="site-description" itemprop="description">这里是玉丸子的个人博客,与你一起发现更大的世界。</div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/yuwanzi.io/archives">
          <span class="site-state-item-count">68</span>
          <span class="site-state-item-name">Artikel</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/yuwanzi.io/categories/">
        <span class="site-state-item-count">39</span>
        <span class="site-state-item-name">Kategorien</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/yuwanzi.io/tags/">
        <span class="site-state-item-count">46</span>
        <span class="site-state-item-name">schlagwörter</span></a>
      </div>
  </nav>
</div>



        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh">
    <link itemprop="mainEntityOfPage" href="https://suyuhuan.gitee.io/yuwanzi.io/2016/08/02/2016-08-2-Spring-security/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/yuwanzi.io/images/avatar.gif">
      <meta itemprop="name" content="玉丸子">
      <meta itemprop="description" content="这里是玉丸子的个人博客,与你一起发现更大的世界。">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="玉丸子 | Blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Spring Security安全控制
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Veröffentlicht am</span>

      <time title="Erstellt: 2016-08-02 18:00:00" itemprop="dateCreated datePublished" datetime="2016-08-02T18:00:00+08:00">2016-08-02</time>
    </span>
      <span class="post-meta-item">
        <span class="post-meta-item-icon">
          <i class="far fa-calendar-check"></i>
        </span>
        <span class="post-meta-item-text">Bearbeitet am</span>
        <time title="Geändert am: 2020-11-07 08:58:17" itemprop="dateModified" datetime="2020-11-07T08:58:17+08:00">2020-11-07</time>
      </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">in</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/yuwanzi.io/categories/%E5%90%8E%E7%AB%AF/" itemprop="url" rel="index"><span itemprop="name">后端</span></a>
        </span>
          . 
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/yuwanzi.io/categories/%E5%90%8E%E7%AB%AF/Java/" itemprop="url" rel="index"><span itemprop="name">Java</span></a>
        </span>
          . 
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/yuwanzi.io/categories/%E5%90%8E%E7%AB%AF/Java/Spring-Boot/" itemprop="url" rel="index"><span itemprop="name">Spring Boot</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h3 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h3><hr>
<p>&nbsp;&nbsp;Spring Security是Spring项目的安全框架,基于IoC和AOP来实现安全的功能.</p>
<p>&nbsp;&nbsp;Spring Security有两个重要概念:</p>
<ul>
<li>认证(Authentication),认证即确认用户可以访问当前系统.</li>
<li>授权(Authorization),授权即确定用户在当前系统下所拥有的权限.</li>
</ul>
<h3 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h3><hr>
<p>&nbsp;&nbsp;Spring Security使用过滤器来实现所有安全的功能,我们只需要注册一个特殊的<strong>DelegationFilterProxy</strong>过滤器到<strong>WebApplicationInitializer</strong>即可(WebApplicationInitializer是Spring提供用来配置Servlet3.0+配置的接口,从而替代web.xml,实现此接口的类会自动被SpringServletContainerInitializer加载,启动Servlet容器).</p>
<p>&nbsp;&nbsp;也可以让自定义的Initializer类继承<strong>AbstractSecurityWebApplicationInitializer</strong>抽象类,这个抽象类实现了WebApplicationInitializer接口,并通过onStartup方法调用.它已经注册了<strong>DelegationFilterProxy</strong>过滤器.</p>
<h4 id="Spring-Security配置类"><a href="#Spring-Security配置类" class="headerlink" title="Spring Security配置类"></a>Spring Security配置类</h4><hr>
<p>&nbsp;&nbsp;只需要在配置类上使用<code>@EnableWebSecurity</code>注解,然后继承<strong>WebSecurityConfigurerAdapter</strong>.可以通过重写configure方法来配置相关的内容.</p>
<p>&nbsp;&nbsp;在Spring Security中,通过重写以下方法放行静态资源:</p>
<p><img src="http://ww1.sinaimg.cn/mw690/63503acbjw1f6lgu4c6xxj20h404x0tn.jpg"></p>
<h4 id="Authentication"><a href="#Authentication" class="headerlink" title="Authentication"></a>Authentication</h4><hr>
<p>&nbsp;&nbsp;在Spring Security中,通过重写以下方法来完成认证的配置:</p>
<p><img src="http://ww3.sinaimg.cn/mw690/63503acbjw1f6lft8zsnrj20mu01i3yx.jpg"></p>
<p>&nbsp;&nbsp;认证用户需要用户数据的来源,AuthenticationManagerBuilder提供了内存中和JDBC的两种用户数据来源.</p>
<ul>
<li><p>内存中</p>
<p><img src="http://ww3.sinaimg.cn/mw690/63503acbjw1f6lft99qxaj20mj05fjsf.jpg"></p>
</li>
<li><p>JDBC</p>
<p><img src="http://ww3.sinaimg.cn/mw690/63503acbjw1f6lft9j25zj20mo09b40j.jpg"></p>
</li>
</ul>
<p>&nbsp;&nbsp;如果需要自定义用户数据来源,则可以通过实现<strong>UserDetailsService</strong>接口.</p>
<p><img src="http://ww2.sinaimg.cn/mw690/63503acbjw1f6lg2d5ezej20gn0cadhp.jpg" alt="Role实体类"></p>
<p><img src="http://ww4.sinaimg.cn/mw690/63503acbjw1f6lg2cv17nj20ls0g80wk.jpg" alt="User实体类"></p>
<p><img src="http://ww3.sinaimg.cn/mw690/63503acbjw1f6lg2dfhjxj20qe0d7tcp.jpg" alt="自定义用户认证"></p>
<p><img src="http://ww2.sinaimg.cn/mw690/63503acbjw1f6lg2dua5xj20md06s75u.jpg" alt="注册自定义的用户认证"></p>
<h4 id="Authorization"><a href="#Authorization" class="headerlink" title="Authorization"></a>Authorization</h4><hr>
<p>&nbsp;&nbsp;在Spring Security中,通过重写以下方法来完成授权的配置:</p>
<p><img src="http://ww4.sinaimg.cn/mw690/63503acbjw1f6lgfcr8g3j20hy01jt8z.jpg"></p>
<p>&nbsp;&nbsp;Spring Security使用2种匹配器用来匹配请求路径:</p>
<ul>
<li>antMatchers:使用Ant风格的路径匹配.</li>
<li>regexMatchers:使用正则表达式匹配路径.</li>
</ul>
<p>&nbsp;&nbsp;Spring Security提供以下方法用于安全处理:</p>
<table>
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td>anyRequest()</td>
<td>匹配所有请求路径.</td>
</tr>
<tr>
<td>access(String)</td>
<td>Spring EL表达式结果为true时可以访问.</td>
</tr>
<tr>
<td>anonymous()</td>
<td>匿名可访问.</td>
</tr>
<tr>
<td>denyAll()</td>
<td>用户不能访问.</td>
</tr>
<tr>
<td>fullyAuthenticated()</td>
<td>用户完全认证时可访问.</td>
</tr>
<tr>
<td>hasAnyAuthority(String…)</td>
<td>如果用户有参数,则其中任一权限可访问.</td>
</tr>
<tr>
<td>hasAnyRole(String…)</td>
<td>如果用户有参数,则其中任一角色可访问.</td>
</tr>
<tr>
<td>hasAuthority(String)</td>
<td>如果用户有参数,则其权限可访问.</td>
</tr>
<tr>
<td>hasIpAddress(String)</td>
<td>如果用户来自参数中的IP则可访问.</td>
</tr>
<tr>
<td>hasRole(String)</td>
<td>如果用户有参数中的角色可访问.</td>
</tr>
<tr>
<td>permitAll()</td>
<td>用户可任意访问.</td>
</tr>
<tr>
<td>rememberMe()</td>
<td>允许通过remember-me登陆的用户访问.</td>
</tr>
<tr>
<td>authenticated()</td>
<td>用户登录后可访问</td>
</tr>
</tbody></table>
<h3 id="自定义登录实现"><a href="#自定义登录实现" class="headerlink" title="自定义登录实现"></a>自定义登录实现</h3><hr>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@Override</span></span><br><span class="line">   <span class="function"><span class="keyword">protected</span> <span class="keyword">void</span> <span class="title">configure</span><span class="params">(HttpSecurity http)</span> <span class="keyword">throws</span> Exception </span>&#123;</span><br><span class="line">       http.authorizeRequests()</span><br><span class="line">               .anyRequest().authenticated() <span class="comment">// 所有请求需要认证登陆后才能访问.</span></span><br><span class="line">               .and()</span><br><span class="line">               .formLogin() <span class="comment">// 通过formLogin定制登录操作.</span></span><br><span class="line">                   .loginPage(<span class="string">&quot;/login&quot;</span>) <span class="comment">// 定制登录页面的访问地址.</span></span><br><span class="line">                   .defaultSuccessUrl(<span class="string">&quot;/index&quot;</span>) <span class="comment">// 登录成功后转向的页面.</span></span><br><span class="line">                   .failureUrl(<span class="string">&quot;/login?error&quot;</span>) <span class="comment">// 登录失败后转向的页面.</span></span><br><span class="line">                   .permitAll() </span><br><span class="line">               .and()</span><br><span class="line">               .rememberMe() <span class="comment">// 开启cookie存储用户信息.</span></span><br><span class="line">                   .tokenValiditySeconds(<span class="number">1209600</span>) <span class="comment">// 指定cookie的有效时间,单位为秒.</span></span><br><span class="line">                   .key(<span class="string">&quot;userKey&quot;</span>) <span class="comment">// 指定cookie中的私钥.</span></span><br><span class="line">               .and()</span><br><span class="line">               .logout() <span class="comment">// 通过logout()定制注销操作.</span></span><br><span class="line">                   .logoutUrl(<span class="string">&quot;/logout&quot;</span>) <span class="comment">// 指定注销的URL路径.</span></span><br><span class="line">                   .logoutSuccessUrl(<span class="string">&quot;/index&quot;</span>) <span class="comment">// 指定注销成功后转向的页面.</span></span><br><span class="line">               .permitAll();    </span><br><span class="line">   &#125;</span><br></pre></td></tr></table></figure>
<h3 id="Spring-Boot支持"><a href="#Spring-Boot支持" class="headerlink" title="Spring Boot支持"></a>Spring Boot支持</h3><hr>
<p>&nbsp;&nbsp;Spring Boot主要通过SecurityAutoConfiguration和SecurityProperties来完成自动配置.</p>
<p>&nbsp;&nbsp;SecurityAutoConfiguration导入了SpringBootWebSecurityConfiguration中的配置,我们可以获得如下的自动配置:</p>
<ol>
<li>自动配置了一个内存中的用户,账号为user,密码在程序启动时print在控制台中.</li>
<li>放行了<code>/css/**</code>,<code>/js/**</code>,<code>/images/**</code>,<code>/**/favicon.ico</code>等静态文件存放的路径.</li>
<li>自动配置的securityFilterChainRegistration的Bean.</li>
<li>使用以<code>security</code>为前缀的属性配置Security相关的配置.<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">security.user.name&#x3D;#内存中的默认用户账号,默认为user.</span><br><span class="line">security.user.password&#x3D;#默认用户的密码.</span><br><span class="line">security.user.role&#x3D;#默认用户的角色.</span><br><span class="line">security.require-ssl&#x3D;false #是否需要ssl支持,默认为false.</span><br><span class="line">security.enable-csrf&#x3D;false #是否开启“跨站请求伪造”支持,默认false.</span><br><span class="line">security.ignored&#x3D; #用逗号隔开需要放行的路径.</span><br><span class="line">....</span><br></pre></td></tr></table></figure></li>
</ol>
<p><strong>当我们需要自定义扩展配置的时候,只需要配置类继承WebSecurityConfigurerAdapter即可,不需要使用<code>@EnableWebSecurity</code>注解开启支持.</strong>    </p>
<h3 id="end"><a href="#end" class="headerlink" title="end"></a>end</h3><blockquote>
<p>资料参考于 JavaEE开发的颠覆者: Spring Boot实战</p>
</blockquote>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/yuwanzi.io/tags/Java/" rel="tag"># Java</a>
              <a href="/yuwanzi.io/tags/Spring/" rel="tag"># Spring</a>
              <a href="/yuwanzi.io/tags/Spring-Boot/" rel="tag"># Spring Boot</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/yuwanzi.io/2016/08/01/2016-08-1-Spring-data-transaction/" rel="prev" title="Spring Data 事务&缓存">
                  <i class="fa fa-chevron-left"></i> Spring Data 事务&缓存
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/yuwanzi.io/2016/08/03/2016-08-3-Spring-message/" rel="next" title="Spring Boot消息通信">
                  Spring Boot消息通信 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>







<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      const activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      const commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">玉丸子</span>
</div>
  <div class="powered-by">Erstellt mit  <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/muse/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a>
  </div>

    </div>
  </footer>

  
  <script src="//cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js"></script>
<script src="/yuwanzi.io/js/utils.js"></script><script src="/yuwanzi.io/js/motion.js"></script><script src="/yuwanzi.io/js/schemes/muse.js"></script><script src="/yuwanzi.io/js/next-boot.js"></script>

  






  





</body>
</html>
